<template>
	<view class="music-head">
		<view class="music-head-icon" v-if="icon" >
			<text class="iconfont icon-zuojiantou" @tap="hendleToBack"></text> | 
			<text class="iconfont icon-shouye" @tap="hendleToHome"></text>
		</view>
		{{title}}
	</view>
</template>

<script>
	export default {
		name:"MusicHead",
		data() {
			return {
				
			};
		},
		methods:{
			// app头部组件
			// app头部组件（按键）
			// 左按键返回上一页
			hendleToBack(){
				history.back()
			},
			// 右按键返回首页
			hendleToHome(){
				uni.navigateTo({
					url:'/pages/index/index'
				})
			}
		},
		props:['title', 'icon']
	}
</script>

<style scoped>
.music-head{
	height: 75px;
	width: 100%;
	font-size: 16px;
	line-height: 80px;
	text-align: center;
	color: #000;
	position: relative;
	display: fixed;
}
.music-head-icon{
	position: absolute;
	left: 4px;
	top: 26px;
	width: 90px;
	height: 31px;
	background-color: rgba(0,0,0,0.4);
	color: white;
	line-height: 31px;
	border-radius: 15px;
	display: flex;
	justify-content: space-evenly;
}
.music-head-icon text{
	margin-top: 2px;
}
</style>